module ScheduledTasksHelper
  def frequency_to_str value_i
    value_str = case value_i
      when Frequency::ASAP then             "scheduled_tasks.frequency.asap"
      when Frequency::FORTNIGHTLY then      "scheduled_tasks.frequency.fortnightly"
      when Frequency::FOUR_TIMES_A_DAY then "scheduled_tasks.frequency.four_times_a_day"
      when Frequency::HALF_HOURLY then      "scheduled_tasks.frequency.half_hourly"
      when Frequency::HOURLY then           "scheduled_tasks.frequency.hourly"
      when Frequency::MONTHLY then          "scheduled_tasks.frequency.monthly"
      when Frequency::TWICE_A_DAY then      "scheduled_tasks.frequency.twice_a_day"
      when Frequency::WEEKLY then           "scheduled_tasks.frequency.weekly"
      when Frequency::DAILY then            "scheduled_tasks.frequency.daily"
      else                                  "scheduled_tasks.frequency.unknow"
    end
    return value_str
  end
end
